package principal;

import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import java.util.Collection;
import java.util.List;

public class Principal {
    private Historia hist;
    
    public Principal() {
        hist = new Historia();
    }
    
    public Historia getHist() {
        return hist;
    }
    
    public static void main(String[] args) {
        Principal p = new Principal();
        p.getHist().adicionar("Palavra agora");
        p.getHist().adicionar("Palavra");
        p.getHist().adicionar("papavragora");
        final String pal = ".*ago.*";
        
        
        Collection<String> aux = Collections2.filter(p.getHist().listar(),new Predicate<String>() {
            @Override
            public boolean apply(String t) {
                return t.matches(pal);
            }
        });
        System.out.println(aux);
    }
}
